package com.ruoyi.manage.mapper;

import java.util.List;
import com.ruoyi.manage.domain.CrApplication;
import org.apache.ibatis.annotations.Param;

/**
 * 学生申请Mapper接口
 */
public interface CrApplicationMapper
{
    /**
     * 查询学生申请
     */
    public CrApplication selectCrApplicationByApplicationId(Long applicationId);

    /**
     * 查询学生申请列表
     */
    public List<CrApplication> selectCrApplicationList(CrApplication crApplication);

    /**
     * 查询学生的申请列表（学生端使用）
     */
    public List<CrApplication> selectStudentApplicationList(@Param("userId") Long userId);

    /**
     * 查询社团的申请列表（社团端使用）
     */
    public List<CrApplication> selectClubApplicationList(@Param("clubId") Long clubId, @Param("status") String status);

    /**
     * 根据招聘ID查询申请列表
     */
    public List<CrApplication> selectApplicationListByRecruitmentId(Long recruitmentId);

    /**
     * 检查学生是否已申请某个招聘
     */
    public CrApplication selectApplicationByUserAndRecruitment(@Param("userId") Long userId, @Param("recruitmentId") Long recruitmentId);

    /**
     * 统计申请数量
     */
    public int countApplicationsByClub(@Param("clubId") Long clubId);

    /**
     * 统计各状态申请数量
     */
    public List<CrApplication> countApplicationsByStatus(@Param("clubId") Long clubId);

    /**
     * 新增学生申请
     */
    public int insertCrApplication(CrApplication crApplication);

    /**
     * 修改学生申请
     */
    public int updateCrApplication(CrApplication crApplication);

    /**
     * 删除学生申请
     */
    public int deleteCrApplicationByApplicationId(Long applicationId);

    /**
     * 批量删除学生申请
     */
    public int deleteCrApplicationByApplicationIds(Long[] applicationIds);

    /**
     * 批量更新申请状态
     */
    public int batchUpdateApplicationStatus(@Param("applicationIds") Long[] applicationIds, @Param("status") String status, @Param("reviewBy") String reviewBy);
}